import React from "react";
import PubSub from "pubsub-js";

class World extends React.Component {
  fn1 = () => {
    // 发布消息
    PubSub.publish("aaa", "李四");
  };
  render() {
    return (
      <div>
        <h1>World</h1>
        <button onClick={this.fn1}>点我给Hello发消息</button>
      </div>
    );
  }
}

export default World;
